package me.heyclock.hl.recordwriter.bean;

import java.util.List;

import me.heyclock.hl.recordwriter.anotation.NotProguard;

/**
 * 录音文本消息
 * {"sn":1,"ls":false,"bg":0,"ed":0,"ws":[{"bg":1,"cw":[{"sc":0.0,"w":"早间"}]},{"bg":1,"cw":[{"sc":0.0,"w":"行情"}]}]}
 */
@NotProguard
public class RecordeBean {
    private int sn;
    private boolean ls;
    private int bg;
    private int ed;
    private List<ws> ws;

    private RecordeBean(){}

    public RecordeBean(int sn, boolean ls, int bg, int ed, List<RecordeBean.ws> ws) {
        this.sn = sn;
        this.ls = ls;
        this.bg = bg;
        this.ed = ed;
        this.ws = ws;
    }

    public class ws{
        private int bg;
        private List<cw> cw;

        private ws(){}

        public ws(int bg, List<RecordeBean.ws.cw> cw) {
            this.bg = bg;
            this.cw = cw;
        }

        public class cw{
            private float sc;
            private String w;

            private cw(){}

            public cw(float sc, String w) {
                this.sc = sc;
                this.w = w;
            }

            public float getSc() {
                return sc;
            }

            public void setSc(float sc) {
                this.sc = sc;
            }

            public String getW() {
                return w;
            }

            public void setW(String w) {
                this.w = w;
            }
        }

        public int getBg() {
            return bg;
        }

        public void setBg(int bg) {
            this.bg = bg;
        }

        public List<RecordeBean.ws.cw> getCw() {
            return cw;
        }

        public void setCw(List<RecordeBean.ws.cw> cw) {
            this.cw = cw;
        }
    }

    public int getSn() {
        return sn;
    }

    public void setSn(int sn) {
        this.sn = sn;
    }

    public boolean isLs() {
        return ls;
    }

    public void setLs(boolean ls) {
        this.ls = ls;
    }

    public int getBg() {
        return bg;
    }

    public void setBg(int bg) {
        this.bg = bg;
    }

    public int getEd() {
        return ed;
    }

    public void setEd(int ed) {
        this.ed = ed;
    }

    public List<RecordeBean.ws> getWs() {
        return ws;
    }

    public void setWs(List<RecordeBean.ws> ws) {
        this.ws = ws;
    }

    public String getAllWs(){
        String result = "";
        if (null != ws){
            for (int i = 0; i < ws.size(); ++i){
                if (null != ws.get(i).getCw()){
                    for (int j = 0; j < ws.get(i).getCw().size(); ++j){
                        result += ws.get(i).getCw().get(j).getW();
                    }
                }
            }
        }
        return result;
    }
}
